#ifndef BUTTON_H
#define BUTTON_H

#include <QPushButton>
#include <QIcon>

class Button : public QPushButton
{
    Q_OBJECT
public:
    explicit Button(QWidget *parent = nullptr);

    // 设置播放和暂停状态的图标
    void setPlayIcon(const QIcon &icon);
    void setPauseIcon(const QIcon &icon);

    // 设置播放状态
    void setPlaying(bool playing);
    bool isPlaying() const;

signals:
    // 状态改变信号
    void playStateChanged(bool isPlaying);

private slots:
    void onButtonClicked();

private:
    QIcon m_playIcon;
    QIcon m_pauseIcon;
    bool m_isPlaying;
};

#endif // BUTTON_H
